package com.mt.grand.singleton.serialize;

import java.io.Serializable;

public class SerializeSingleton implements Serializable{

    private static final long serialVersionUID = 7995083096656644163L;

    private static SerializeSingleton singleton = new SerializeSingleton();

    public static SerializeSingleton getInstance(){
        return singleton;
    }

    //通过重写此方法可以避免序列化破坏单例
    private Object readResolve(){
        return singleton;
    }
}